package com.yeqifu.bus.service.impl;

import com.yeqifu.bus.domain.Car;
import com.yeqifu.bus.mapper.CarMapper;
import com.yeqifu.bus.service.ICarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarServiceImpl implements ICarService {

    @Autowired
    private CarMapper carMapper;

    /**
     * 查询所有信息
     *
     * @param car
     * @return
     */
    @Override
    public List<Car> selectCarList(Car car) {
        return carMapper.selectCarList(car);
    }

    /**
     * 添加一个车辆
     *
     * @param car
     */
    @Override
    public int addCar(Car car) {
        return carMapper.addCar(car);
    }

    /**
     * 更新一个车辆
     *
     * @param car
     */
    @Override
    public int updateCar(Car car) {
        return carMapper.updateCar(car);
    }

    /**
     * 删除一个车辆
     *
     * @param
     */
    @Override
    public int deleteCar(Car car) {
        return carMapper.deleteCar(car);
    }


    /**
     * 批量删除车辆
     * @param
     */
    @Override
    public void deleteBatchCar(String[] ids) {
        for (String id : ids) {
            carMapper.deleteBatchCarr(id);
        }
    }

}


